home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / EModules / system / events.e < prev    next >
Encoding:
Text File  |  1997-12-03  |  2.8 KB  |  82 lines

  1. /*
  2. **  $VER: events.e V0.9B
  3. **
  4. **  (C) Copyright 1996-1997 DreamWorld Productions.
  5. **      All Rights Reserved.
  6. **
  7. */
  8.  
  9. OPT MODULE
  10. OPT EXPORT
  11. OPT PREPROCESS
  12.  
  13. MODULE 'dpkernel/dpkernel','system/register','system/tasks'
  14.  
  15. /*****************************************************************************
  16. ** The Event Node.
  17. */
  18.  
  19. CONST TAGS_EVENT = $FFFB0000 OR ID_EVENT
  20.  
  21. OBJECT event
  22.   next     :PTR TO event     /* [00] Next event node */
  23.   prev     :PTR TO event     /* [04] Previous event node */
  24.   routine  :LONG             /* [08] Function call! */
  25.   args     :PTR TO LONG      /* [12] Event arguments */
  26.   priority :INT              /* [16] Sets position in the event chain */
  27.   number   :INT              /* [18] Event number */
  28.   flags    :LONG             /* [20] Special flags */
  29.   task     :PTR TO dpktask   /* [24] Task owner */
  30. ENDOBJECT
  31.  
  32. OBJECT evtentry
  33.   event   :PTR TO event
  34.   routine :LONG
  35. ENDOBJECT
  36.  
  37. /* Event Structure Tags */
  38.  
  39. CONST EVA_Routine  = TAPTR OR 8,
  40.       EVA_Args     = TAPTR OR 12,
  41.       EVA_Priority = TWORD OR 16,
  42.       EVA_Number   = TWORD OR 18,
  43.       EVA_Flags    = TLONG OR 20
  44.  
  45. /* Event->Flags */
  46.  
  47. CONST EVF_ON        = $00000001,  /* Call routine on event (default) */
  48.       EVF_AFTER     = $00000002,  /* Call routine after event */
  49.       EVF_UNTRACKED = $00000004,  /* Do not track the event node */
  50.       EVF_GLOBAL    = $00000008,  /* Always call if event occurs (default) */
  51.       EVF_TASK      = $00000010   /* Call if I am the active task */
  52.  
  53. /* Return flags for Event->Routine() and CallEventList() */
  54.  
  55. CONST EVR_BREAK     = $00000001, /* Do not execute any more events */
  56.       EVR_FAIL      = $00000002  /* Return immediately (failure) */
  57.  
  58. /*****************************************************************************
  59. ** Available event types.
  60. */
  61.  
  62. CONST EVTNODE = 0,
  63.       EVTCALL = $80000000
  64.  
  65. CONST EVT_OnNewTask    =  1 OR EVTNODE,   /* A new task is appearing */
  66.       EVT_OnRemTask    =  2 OR EVTNODE,   /* An existing task is being removed */
  67.       EVT_ab           =  3 OR EVTNODE,   /* */
  68.       EVT_ac           =  4 OR EVTNODE,   /* */
  69.       EVT_ad           =  5 OR EVTNODE,   /* Args: <TimesPerSecond> */
  70.       EVT_ae           =  6 OR EVTNODE,   /* Args: <Task> */
  71.       EVT_af           =  7 OR EVTNODE,   /* Args: <Task> */
  72.       EVT_Timer        =  8 OR EVTCALL,   /* Args: <MicroSeconds> */
  73.       EVT_DiskInsert   =  9 OR EVTNODE,   /* Args: <None> */
  74.       EVT_DiskRemove   = 10 OR EVTNODE,   /* Args: <None> */
  75.       EVT_SelfDestruct = 11 OR EVTNODE,   /* Args: <Task>   */
  76.       EVT_OnDisplay    = 12 OR EVTNODE,   /* Args: <Task>   */
  77.       EVT_Expunge      = 13 OR EVTNODE,   /* Args: <None>   */
  78.       EVT_LowMemory    = 14 OR EVTNODE,   /* Args: <PercentageLeft> */
  79.       EVT_PlaySound    = 15 OR EVTCALL,   /* Args: <Task/Object>    */
  80.  
  81.       EVT_END          = 200  /* Maximum amount of events for this version */
  82.